package com.hongxun.modules.csg.service.impl;

import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.hongxun.modules.csg.dao.CPBaseDao;
import com.hongxun.modules.csg.entity.CPBaseEntity;
import com.hongxun.modules.csg.service.CPBaseService;



@Service("cPBaseService")
public class CPBaseServiceImpl implements CPBaseService {
	@Autowired
	private CPBaseDao cPBaseDao;
	
	@Override
	public CPBaseEntity queryObject(String guid){
		return cPBaseDao.queryObject(guid);
	}
	
	@Override
	public List<CPBaseEntity> queryList(Map<String, Object> map){
		return cPBaseDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return cPBaseDao.queryTotal(map);
	}
	
	@Override
	public void save(CPBaseEntity cPBase){
        if(cPBase.getGuid()==null||cPBase.getGuid().equals("")) {

		    cPBase.setGuid(UUID.randomUUID().toString());
        }
		cPBaseDao.save(cPBase);
	}
	
	@Override
	public void update(CPBaseEntity cPBase){
		cPBaseDao.update(cPBase);
	}
	
	@Override
	public void delete(String guid){
		cPBaseDao.delete(guid);
	}
	
	@Override
	public void deleteBatch(String[] guids){
		cPBaseDao.deleteBatch(guids);
	}

	@Override
	public void logical_delete(String[] guids){
		cPBaseDao.logical_delete(guids);
	}
}
